#!/bin/bash

gdb_path="/data/home/xiaoq/dataset/gdb-gz/"
gcc_path="/data/home/xiaoq/dataset/gcc-gz/"
redis_path="/data/home/wf/redis/"

path=$gdb_path
dataset="gdb"

./rebuild
perf record -g ./destor $path > total.txt
perf script -i perf.data > perf.unfold
../FlameGraph/stackcollapse-perf.pl perf.unfold > perf.folded
../FlameGraph/flamegraph.pl perf.folded > perf.svg
mkdir sf_$dataset/
mv perf.svg sf_$dataset/
mv excel_* sf_$dataset/
mv total.txt sf_$dataset/


./rebuild
perf record -g ./destor $path -p"sketch-method sisd_fixed_rabin" > total.txt
perf script -i perf.data > perf.unfold 
../FlameGraph/stackcollapse-perf.pl perf.unfold > perf.folded
../FlameGraph/flamegraph.pl perf.folded > perf.svg
mkdir rabin_$dataset/
mv perf.svg rabin_$dataset/
mv excel_* rabin_$dataset/
mv total.txt rabin_$dataset/



./rebuild
perf record -g ./destor $path -p"sketch-method sisd_fixed_gear" > total.txt
perf script -i perf.data > perf.unfold 
../FlameGraph/stackcollapse-perf.pl perf.unfold > perf.folded
../FlameGraph/flamegraph.pl perf.folded > perf.svg
mkdir gear_$dataset/
mv perf.svg gear_$dataset/
mv excel_* gear_$dataset/
mv total.txt gear_$dataset/


./rebuild
